const {mongodb,Schema} = require("./baseDB/db-movies");
//2.在本地定义一个Schema和远程数据库的字段映射
var UserSchema =new Schema({
    name:String,
    collectsMovies:[
        {
            pic:String,
            title:String,
            raiting:String,
            slogo:String,
            evaluate:String,
            labels:Array,
            collected:Boolean
        }
    ],
    collectsArticles:[
        {
            date:String,
            title:String,
            imgSrc:String,
            avatar:String,
            content:String,
            reading:Number,
            collections:Number,
            headImgSrc:String,
            dateTime:String,
            detail:String,
            postId:Number,
            music:{
                url:String,
                title:String,
                coverImg:String,
            },
            collected:Boolean,
        }
    ],
    historyArticles:[
        {
            date:String,
            title:String,
            imgSrc:String,
            avatar:String,
            content:String,
            reading:Number,
            collections:Number,
            headImgSrc:String,
            dateTime:String,
            detail:String,
            postId:Number,
            music:{
                url:String,
                title:String,
                coverImg:String,
            },
            collected:Boolean,
        }
    ],
    historyMovies:[
        {
            pic:String,
            title:String,
            raiting:String,
            slogo:String,
            evaluate:String,
            labels:Array,
            collected:Boolean
        }
    ],
});
// 3.创建数据模型，操作数据库
    var UserModel =  mongodb.model("User",UserSchema,"user");  //是我们获取的数据库里User的那张表
module.exports = UserModel;